<template>
  <!-- <van-search v-model="value" placeholder="请输入搜索关键词" /> -->
  <van-swipe class="my-swipe" :autoplay="5000" lazy-render>
    <van-swipe-item v-for="(image, index) in images" :key="index">
      <img :src="image.src" />
      <!-- @click="
                toshop(image.url, $store.state.userInfo.F_Question)
              " -->
    </van-swipe-item>
  </van-swipe>
  <van-overlay :show="showherf" z-index="10001">
    <div class="wrapper" @click.stop>
      <van-loading type="spinner" color="#fff" size="3rem" vertical
        >前往商城</van-loading
      >
    </div>
  </van-overlay>
  <!-- <div class="my-swipe" style="
    position: fixed;
    top: 0;
    z-index: -1;
"><img src="//bpic.588ku.com//back_origin_min_pic/20/02/29/f0bdaaf2ffc7f89e273078340788b1da.jpg!/fw/750/quality/99/unsharp/true/compress/true"></div> -->
</template>
<script>
import { reactive, toRefs } from "@vue/reactivity";

export default {
  name: "swipe",
  setup() {
    const data = reactive({
      images: [
        //  {
        //   src: "http://www.higuang365.com/public/images/common/banner/hai5-1.jpg",
        //   url: "javascript:void(0)",
        // },
        // {
        //   src: "http://www.higuang365.com/public/images/common/banner/mother.jpg",
        //   url: "javascript:void(0)",
        // },
        {
          src:
            "http://www.higuang365.com/public/images/common/banner/pijiu.jpg",
          url: "javascript:void(0)",
        },
        {
          src:
            "http://www.higuang365.com/public/images/common/banner/3.jpg",
          url: "javascript:void(0)",
        },
        {
          src:
            "http://www.higuang365.com/public/images/common/banner/5_pro.jpg",
          url: "javascript:void(0)",
        },
        // {
        //   src: "http://www.higuang365.com/public/images/common/banner/11_8.jpg",
        //   url: "javascript:void(0)",
        // },

        {
          src:
            "http://www.higuang365.com/public/images/common/banner/10_8_pro.jpg",
          url: "javascript:void(0)",
        },

        {
          src:
            "http://www.higuang365.com/public/images/69/30/ef/67029d5692a73274e4c2a78c654a933420e053b3.jpg??1590812559#w",
          url: "http://www.higuang365.com/wap/article-75.html",
        },
      ],
      showherf: false,
    });
    //销售说要让客户看出来是两个系统跳转
    const toshop = (F_ProductId, F_Question) => {
      data.showherf = true;
      setTimeout(() => {
        data.showherf = false;
        window.location.href =
          "http://www.higuang365.com/wap/product-" +
          F_ProductId +
          ".html" +
          (F_Question ? "?parents_id=" + F_Question : "");
      }, 2000);
    };
    return { ...toRefs(data), toshop };
  },
};
</script>
<style lang="scss" scope>
.my-swipe {
  img {
    width: 100%;
    height: 100%;
  }
}
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2rem;
}
</style>
